/*
 * Powered By [fdlm]
 * Web Site: http://www.fdlm.cn
 * Since 2014 - 2015
 */

package com.sjyy.orderdetail.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import com.sjyy.orderdetail.model.*;
import com.sjyy.orderdetail.service.*;
import com.sjyy.orderdetail.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @author cty email:caotianye@fdlm.cn
 * @version 1.0
 * @since 1.0
 */


public class OrderDetail extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "OrderDetail";
	public static final String ALIAS_ORDER_DETAIL_ID = "orderDetailId";
	public static final String ALIAS_ORDER_ID = "orderId";
	public static final String ALIAS_USER_ID = "userId";
	public static final String ALIAS_ROLE_ID = "roleId";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_TYPE = "type";
	public static final String ALIAS_CONTENT = "content";
	public static final String ALIAS_CREATE_TIME = "createTime";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** orderDetailId       db_column: order_detail_id */	
	
	private java.lang.Integer orderDetailId;
    /** orderId       db_column: order_id */	
	@NotNull 
	private java.lang.Integer orderId;
    /** userId       db_column: user_id */	
	@NotNull 
	private java.lang.Integer userId;
    /** roleId       db_column: role_id */	
	@NotNull 
	private java.lang.Integer roleId;
    /** status       db_column: status */	
	@NotNull 
	private java.lang.Integer status;
    /** type       db_column: type */	
	
	private java.lang.Integer type;
    /** content       db_column: content */	
	@Length(max=256)
	private java.lang.String content;
    /** createTime       db_column: create_time */	
	@NotNull 
	private java.util.Date createTime;
	//columns END

	public OrderDetail(){
	}

	public OrderDetail(
		java.lang.Integer orderDetailId
	){
		this.orderDetailId = orderDetailId;
	}

	public void setOrderDetailId(java.lang.Integer value) {
		this.orderDetailId = value;
	}
	
	public java.lang.Integer getOrderDetailId() {
		return this.orderDetailId;
	}
	public void setOrderId(java.lang.Integer value) {
		this.orderId = value;
	}
	
	public java.lang.Integer getOrderId() {
		return this.orderId;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setRoleId(java.lang.Integer value) {
		this.roleId = value;
	}
	
	public java.lang.Integer getRoleId() {
		return this.roleId;
	}
	public void setStatus(java.lang.Integer value) {
		this.status = value;
	}
	
	public java.lang.Integer getStatus() {
		return this.status;
	}
	public void setType(java.lang.Integer value) {
		this.type = value;
	}
	
	public java.lang.Integer getType() {
		return this.type;
	}
	public void setContent(java.lang.String value) {
		this.content = value;
	}
	
	public java.lang.String getContent() {
		return this.content;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("OrderDetailId",getOrderDetailId())
			.append("OrderId",getOrderId())
			.append("UserId",getUserId())
			.append("RoleId",getRoleId())
			.append("Status",getStatus())
			.append("Type",getType())
			.append("Content",getContent())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getOrderDetailId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OrderDetail == false) return false;
		if(this == obj) return true;
		OrderDetail other = (OrderDetail)obj;
		return new EqualsBuilder()
			.append(getOrderDetailId(),other.getOrderDetailId())
			.isEquals();
	}
}

